package com.quasar.hpatient.presenter;

import com.quasar.hpatient.model.httpmodel.DataStateResult;
import com.quasar.hpatient.model.requestmodel.RequestModel;
import com.quasar.hpatient.onInterface.AnotherResultListener;
import com.quasar.hpatient.onInterface.viewInterface.UiInterface;

/**
 * author : 许建宏
 * Date: 2017/11/3 0003
 * View:申请医生
 */

public class UpdateDoctorPatientPresenter {

    private RequestModel requestModel;
    private UiInterface<DataStateResult> uiInterface;

    public UpdateDoctorPatientPresenter(UiInterface<DataStateResult> uiInterface) {
        this.requestModel = new RequestModel();
        this.uiInterface = uiInterface;
    }
    public void PostUpdateDoctorPatient(String doctorId){

        requestModel.UpdateDoctorPatientData(doctorId, new AnotherResultListener<DataStateResult>() {
            @Override
            public void onSuccess(DataStateResult data) {
                uiInterface.onViewSuccess(data);
            }

            @Override
            public void onError(String msg) {
                uiInterface.onViewError(msg);
            }

            @Override
            public void onRefreshUI() {
                uiInterface.onViewRefreshUI();
            }
        });

    }
}
